-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modified to run captureSession.startRunning() on a background thread #378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution!
Code Coverage Report
SwiftLint found issues
Generated by 🚫 Danger Swift against bbba45c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will make an additional pull request reflecting BasThomas's review.
…prevent runtime errors related to unwrapping a nil optional value.
It looks unrelated #375 build issue is affecting Bitrise fail. |
Bitrise succeeded. Please advise, as there isn't a relationship between the threads and the precision of rectangle detection in the current code. |
@hajunho are tests succeeding for you locally? Also, do you agree this test failure seems unrelated to your code changes? |
Yes, the tests went well locally. The test failures are not related to my code changes. However, errors at runtime should be taken seriously. It seems necessary to look closely at this problem and check if the environment settings or any recent changes have impacted it. Test benches are not easily created. So, I will search the code more and examine the parts needed for performance improvement. Could you provide any additional information or logs related to this test failure or the test bench? That information might help in identifying the cause of the problem. Additionally, I'd like to know if there's a way to visually inspect the two snapshots created by the test bench and then download the test result images for analysis with various tools to identify the differences. |
@hajunho completely agree. I don't think we can access the test snapshots, so we really need to find a way to reproduce the test failure locally. My guess is that it results from a different Simulator used on CI. CI runs using the following destination:
We've also not updated Xcode yet, so it's using Xcode 14.3.1 at this point. Feel free to take up the challenge to solve the test in this PR! If not, let me know, and we'll merge this PR based on your local CI succession. |
Thank you for your insights. If I'm able to reproduce the issue and find a fix, I'll update the PR with the necessary changes. |
The attached image shows the head minus my PR. In the case of sub-items, there are a lot of fail cases, so it seems like there is confusion about fail for that item. Even if it is not my PR, the test fails in the existing main branch code. The same goes for iPhone SE~15pro. I'll have to spend some time exploring that test case. Can I leave this commit open until then? |
The precision numbers in the existing code match ideally, so there is no PR impact. It would be better to separate the test failure into another problem. Please merge when you are ready. |
Thanks for diving deeper into the specifics! 🙏 We'll have a look at tests separately. |
It is more robust in thread management, ensuring that the start of the capture session does not block the main thread and that UI updates are performed on the main thread. Additionally, it carefully manages memory by using [weak self] to avoid retained cycles.